<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui"
	template="/WEB-INF/templates/layoutCourtier.xhtml">

	<ui:define name="content">
		<h:form>

			<p:menu>
				<p:submenu label="">
					<p:menuitem value="#{msgs.listeSinistres}"
						action="verslistesinistres" icon="ui-icon ui-icon-star" />
				</p:submenu>
			</p:menu>

		</h:form>

		<h:form id="mainForm">


			<p:panel header="#{msgs.nouveauSinistre}"
				style="width:50%;height:800px;">


				<p:fieldset legend="#{msgs.sinistre}" toggleable="false">

					<h:outputText value="#{msgs.selectionnezPolice}:" />

					<p:scrollPanel header="" style="width:300px;height:200px;">
						<p:dataTable var="police" id="police"
							value="#{manage.serviceClient.toutesLesPolices}"
							rowKey="#{police.key}" widgetVar="police"
							selection="#{manage.policeChoisie}" selectionMode="single">

							<p:ajax event="rowSelect" listener="#{manage.onRowSelectP}"
								update="mainForm" />

							<p:column sortBy="#{police.client.raisonSociale}">
								<f:facet name="header">
									<h:outputText value="Client" />
								</f:facet>
								<h:outputText value="#{police.client.raisonSociale}" />
							</p:column>

							<f:facet name="header">

							</f:facet>

							<p:column filterBy="#{police.numeroPolice}"
								filterMatchMode="contains">
								<f:facet name="header">
									<h:outputText value="#{msgs.numero}" />
								</f:facet>
								<h:outputText value="#{police.numeroPolice}" />


							</p:column>

						</p:dataTable>

					</p:scrollPanel>

					<p:separator style="width:1px;height:1px" />

					<h:panelGrid columns="1" styleClass="container-horizontally-left"
						cellpadding="2">

						<h:outputLabel for="numeroSinistre" value="#{msgs.numero}:" />
						<p:inputText id="numeroSinistre"
							value="#{manage.sinistre.numeroSinistre}" required="true"
							requiredMessage="#{msgs.messageNumero}">
						</p:inputText>
						<p:message id="msgNumeroSinistre" for="numeroSinistre" />

						<h:outputLabel for="prenom" value="#{msgs.prenom}:" />
						<p:inputText id="prenom" value="#{manage.sinistre.prenom}"
							required="true" requiredMessage="#{msgs.messagePrenom}">
						</p:inputText>
						<p:message id="msgPrenom" for="prenom" />

						<h:outputLabel for="nom" value="#{msgs.nom}" />
						<p:inputText id="nom" value="#{manage.sinistre.nom}"
							required="true" requiredMessage="#{msgs.messageNom}">
						</p:inputText>
						<p:message id="msgNom" for="nom" />

						<h:outputLabel for="dateDebut" value="#{msgs.debutPeriode}:" />
						<p:calendar id="dateDebut" pattern="dd/MM/yyyy"
							value="#{manage.sinistre.dateDebut}" required="false" />
						<p:message id="msgDateDebut" for="dateDebut" />

						<h:outputLabel for="dateFin" value="#{msgs.finPeriode}:" />
						<p:calendar id="dateFin" pattern="dd/MM/yyyy"
							value="#{manage.sinistre.dateFin}" required="false" />
						<p:message id="msgDateFin" for="dateFin" />

						<h:outputLabel for="indemnite" value="#{msgs.indemnite}:" />
						<p:inputText id="indemnite" value="#{manage.sinistre.indemnite}"
							required="true" requiredMessage="#{msgs.messageMontant}">
						</p:inputText>
						<p:message id="msgIndemnite" for="indemnite" />


					</h:panelGrid>


					<h:panelGroup>

						<h:panelGrid columns="3" style="width: 100%;"
							columnClasses="alignleft, aligncenter, alignright">


							<p:commandButton image="ui-icon ui-icon-refresh" immediate="true"
								style="width:120px" value="#{msgs.effacer}" action="refresh"
								ajax="false" />

							<p:commandButton image="ui-icon ui-icon-disk" style="width:120px"
								value="#{msgs.enregistrer}" action="#{manage.ajouterSinistre}"
								ajax="false" disabled="#{manage.bouton1Desactive}" />

						</h:panelGrid>
					</h:panelGroup>

				</p:fieldset>


			</p:panel>
		</h:form>
	</ui:define>
</ui:composition>